//
//  HMBtn.swift
//  swift一遍敲
//
//  Created by 刘耀宗 on 16/4/20.
//  Copyright © 2016年 刘耀宗. All rights reserved.
//

import UIKit

class HMBtn: UIButton {
    override init(frame: CGRect) {
        super.init(frame: frame)
     
        let accessAcount = HMUserAccessModel.shareAccessModel.userAccess?.screen_name
        self.setTitle(accessAcount, forState: UIControlState.Normal)
        self.setTitleColor(UIColor.redColor(), forState: UIControlState.Normal)
        self.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        self.sizeToFit()
       
        
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        self.titleLabel?.frame.origin.x = 0
        self.imageView?.frame.origin.x = (self.titleLabel?.frame.size.width)!
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    

}
